{% extends "fitbeats/base.html" %}

{% block content %}
    <ul id="subnavigation">
        <li class="nav_back"><a href="{% url fitbeats.views.view_trajectories pattern.id %}">Back to Trajectories</a></li>
        {% for t in trajectory_types %}
            <li class="nav_add{% ifequal trajectory_type t.0 %} selected{% endifequal %}"><a href="{% url add_trajectory pattern.id,t.0 %}">Add {{t.1}} Trajectory</a></li>
        {% endfor %}
    </ul>
    
    <h2>{{pattern}}</h2>

    {% if errors %}
        <p class="errornote">
        Please correct the error below.
        </p>
        
        {{form.errors}}
    {% endif %}
    
    <form method="POST">
    {{form.as_p}}

    {% if value_forms %}
        <div class="subform">
            {% for f in value_forms %}
                <table>
                {{f}}
                </table>
            {% endfor %}
        </div>
    {% endif %}

    <input type="submit" value="Save" />
    </form>

    {% ifequal trajectory.trajectory_type "coordinate" %}
        <div style="position: relative; left: 325px; top: -214px;">
            <iframe src="{% url fitbeats.views.xml_trajectory pattern.id,trajectory.id %}" width="300px" height="100%"></iframe>
        </div>
    {% endifequal %}
{% endblock %}
